class StartView extends egret.Sprite{
	public static START_VIEW:string="startview";//设置的切换场景
	private backdropView = new BackdropGame();//背景层
	private peopleView= new PeopleGame();//人物
	private homeView = new HomeGame();//房子
	private darknessView = new BackgroundStart();//遮盖层
	private butView = new ButStart();//按钮层
	public constructor() {
		super();
	};
	public init(){
		this.addChild(this.backdropView);
		this.addChild(this.homeView);// 房子
		this.addChild(this.peopleView);// 人物
		this.addChild(this.darknessView);//遮盖层
		this.addChild(this.butView);//按钮层
		this.butView.init();
		this.butView.startBut.addEventListener(egret.TouchEvent.TOUCH_TAP,this.startPlay,this);//开始
	};
	
	// 暂停游戏
	private endBut() {  
		// console.log("暂停游戏")
		this.backdropView.end();//停止运行背景层
	};
	// 选择场景
	private startPlay() {
		// console.log("切换场景")
		this.removeChildren();
		var changeEvent = new ChangeEvent(ChangeEvent.CHANGE_EVENT);
		changeEvent.eventType = GameagentView.GAMEAGENT_VIEW;
		changeEvent.obj = this;
		SwitcherView.getInstance().dispatchEvent(changeEvent);
	};
	// 结束此场景
	public endView(){
		// console.log("执行");
		this.removeChildren();
		if(this.hasEventListener(egret.TouchEvent.TOUCH_TAP))
			this.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.startPlay,this);
	};
}